<template>
  <div>
    <ContentTitle :info="ctInfo" />
    <template>
      <el-table :data="rechargeList"  style="width: 100%">
        <el-table-column type="index" label="序号"  width="180"> </el-table-column>
        <el-table-column prop="id" label="充值id"> </el-table-column>
        <el-table-column label="日期">
           <template slot-scope="scope">
            {{ scope.row.cTime | uTimeType }}
          </template>
        </el-table-column>
        <el-table-column prop="amount" label="充值金额"> </el-table-column>
        <el-table-column prop="desc" label="备注"> </el-table-column>
      </el-table>
    </template>
  </div>
</template>

<script>
import ContentTitle from "@/components/ContentTitle.vue";
import { $feeRechargeList } from "@/api/index.js";
export default {
  name: "recharge",
  components: { ContentTitle },
  data() {
    return {
      ctInfo: {
        type: "计费",
        text: "充值记录",
        msg: "展现当前账户的消息额度的所有充值记录",
      },
      rechargeList: [],
    };
  },
  filters: {
    uTimeType(value) {
      let value1 = value *1
      let date = new Date(value1);
      let y = date.getFullYear(); // 获取完整的年份(4位,1970)
      let m = date.getMonth()+1; // 获取月份(0-11,0代表1月,用的时候记得加上1)
      let d = date.getDate(); // 获取日(1-31)
      let y1 = y < 10 ? "0" + y : y;
      let m1 = m < 10 ? "0" + m : m;
      let d1 = d < 10 ? "0" + d : d;
      return `${y1} - ${m1} - ${d1}`;
    },
  },
  created() {
    this.getFee();
  },
  methods: {
    getFee() {
      $feeRechargeList().then((res) => {
        console.log(res.data.data);
        this.rechargeList = res.data.data;
      });
    },
  },
};
</script>

<style>
</style>